package com.earthchen.domain.entity.user;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.earthchen.domain.entity.BaseEntity;

import javax.validation.constraints.NotEmpty;
import java.util.Arrays;


/**
 * 角色对象 sys_role
 *
 * @author 占超群
 */
@TableName("t_sys_role")
public class Role extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /**
     * 角色名称
     */
    @NotEmpty(message = "角色名称不能为空")
    private String roleName;

    /**
     * 角色权限
     */
    @NotEmpty(message = "角色关键字不能为空")
    private String roleKey;

    /**
     * 角色排序
     */
    private String roleSort;

    /**
     * 角色状态（0正常 1停用）
     */
    private String status;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    private String delFlag;

    private String createBy;

    private String updateBy;

    private String remark;

    /**
     * 数据范围（1：所有数据权限；2：自定数据权限）
     */
    @TableField(exist = false)
    private String dataScope;

    /**
     * 用户是否存在此角色标识 默认不存在
     */
    @TableField(exist = false)
    private boolean flag = false;

    /**
     * 资源组
     */
    @TableField(exist = false)
    private Long[] resourceIds;

    /**
     * 部门组（数据权限）
     */
    @TableField(exist = false)
    private Long[] deptIds;


    public Long[] getDeptIds()
    {
        return deptIds;
    }

    public void setDeptIds(Long[] deptIds)
    {
        this.deptIds = deptIds;
    }

//    {
//        return roleId;
//    }
//
//    public void setRoleId(Long roleId)
//    {
//        this.roleId = roleId;
//    }

    public String getRoleName()
    {
        return roleName;
    }

    public void setRoleName(String roleName)
    {
        this.roleName = roleName;
    }

    public String getRoleKey()
    {
        return roleKey;
    }

    public String getCreateBy()
    {
        return createBy;
    }

    public void setCreateBy(String createBy)
    {
        this.createBy = createBy;
    }

    public String getUpdateBy()
    {
        return updateBy;
    }

    public void setUpdateBy(String updateBy)
    {
        this.updateBy = updateBy;
    }

    public String getRemark()
    {
        return remark;
    }

    public void setRemark(String remark)
    {
        this.remark = remark;
    }

    public void setRoleKey(String roleKey)
    {
        this.roleKey = roleKey;
    }

    public String getRoleSort()
    {
        return roleSort;
    }

    public void setRoleSort(String roleSort)
    {
        this.roleSort = roleSort;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public boolean isFlag()
    {
        return flag;
    }

    public void setFlag(boolean flag)
    {
        this.flag = flag;
    }

    public String getDelFlag()
    {
        return delFlag;
    }

    public void setDelFlag(String delFlag)
    {
        this.delFlag = delFlag;
    }

    public String getDataScope()
    {
        return dataScope;
    }

    public void setDataScope(String dataScope)
    {
        this.dataScope = dataScope;
    }

    public Long[] getResourceIds()
    {
        return resourceIds;
    }

    public void setResourceIds(Long[] resourceIds)
    {
        this.resourceIds = resourceIds;
    }

    @Override
    public String toString()
    {
        return "Role{" +
               "roleName='" + roleName + '\'' +
               ", roleKey='" + roleKey + '\'' +
               ", roleSort='" + roleSort + '\'' +
               ", status='" + status + '\'' +
               ", flag=" + flag +
               ", resourceIds=" + Arrays.toString(resourceIds) +
               '}';
    }


}
